<template>
	<view class="inform">
		<headertop title="意见反馈" str1="oridei" :back1="back1"></headertop>
		<image src="https://jingwei.xunfuzhifuzaixian.com/static/images/Rectangle 23094@2x.png" class="inform_back"
			mode=""></image>
		<view class="contents">
			<view class="msgicon" v-if="!list.length">
				<image :src="_static('https://jingwei.xunfuzhifuzaixian.com/static/images/wxnone.png')" mode="widthFix">
				</image>
				<view class="msgtext">
					暂无内容
				</view>
			</view>
			<view class="contents_items" v-for="(item,index) in list" :key="index" v-if="list.length">
				<view class="contents_items_venter">
					<view class="contents_items_venter_top">
						<view class="contents_items_venter_top_btn">
							{{item.type}}
						</view>

						<view class="contents_items_venter_top_t1">
							提交时间：{{timestampfun(item.createtime*1000)}}
						</view>
					</view>
					<view class="contents_items_venter_bottom">
						<view class="contents_items_venter_bottom_t1">
							{{item.title}}
						</view>
						<view class="contents_items_venter_bottom_t2">
							{{item.content}}
						</view>
						<view class="contents_items_venter_bottom_t2" style="margin-top: 30rpx;" v-if="item.status==1">
							<span style="color: #1D2129;font-weight: bold;">官方回复：</span><span
								style="color: #1D2129;">{{item.remark||''}}</span>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="" style="height: 200rpx;">

		</view>
		<view class="fixedbox">
			<view class="btn" @click="gopage">
				我要反馈
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		_static
	} from '@/ulm/utils/url.js'
	import headertop from '@/components/header.vue'
	import {
		onPageScroll,
		onLoad,
		onShow,
		onReachBottom
	} from "@dcloudio/uni-app";
	import {
		$api
	} from '../../ulm';
	import {
		ref,
		onMounted,
		reactive,
	} from 'vue'
	const back1 = ref('')
	const barHeight = ref('')
	const statusBarHeight = ref('')
	const total = ref(0)
	const list = ref([])
	const query = reactive({
		page: 1,
		limit: 10
	})
	onPageScroll((e) => {
		if (e.scrollTop > 100) {
			back1.value = '#CAEEFF'
		} else {
			back1.value = ''
		}
	})
	onReachBottom(() => {
		if (total.value > list.value.length) {
			query['page']++
			initlist()
		}
	})

	function timestampfun(time) {
		const date = new Date(time);
		const year = date.getFullYear();
		const month = String(date.getMonth() + 1).padStart(2, "0");
		const day = String(date.getDate()).padStart(2, "0");
		const hours = String(date.getHours()).padStart(2, "0");
		const minutes = String(date.getMinutes()).padStart(2, "0");
		const seconds = String(date.getSeconds()).padStart(2, "0");
		const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`;
		return formattedDate
	}
	onShow(() => {
		query.page = 1
		list.value = []
		initlist()
	})
	async function initlist() {
		const res = await $api.yijianlog(query)
		if (res.code == 1) {
			list.value.push(...res.data.list)
			total.value = res.data.count
		}
	}

	function gopage() {
		uni.navigateTo({
			url: '/sub_me/index/fankuicreate'
		})
	}
</script>

<style lang="scss">
	.msgicon {
		width: 608rpx;
		margin: 100rpx auto;
		overflow: hidden;

		.msgtext {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #86909C;
			text-align: center;
			width: 100%;
			margin-top: 30rpx;
		}

		image {
			width: 608rpx;
		}
	}

	page {
		background: #F7F8FA;
	}

	.inform {
		width: 100%;
		overflow: hidden;
		position: relative;

		.fixedbox {
			width: 100%;
			overflow: hidden;
			height: 184rpx;
			border-radius: 0rpx 0rpx 0rpx 0rpx;
			position: fixed;
			bottom: 0%;

			.btn {
				width: 686rpx;
				height: 88rpx;
				background: #13A2E6;
				border-radius: 16rpx;
				text-align: center;
				line-height: 88rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 30rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 88rpx;
				margin: auto;
				margin-top: 22rpx;
			}
		}

		&_back {
			width: 100%;
			height: 278rpx;
			position: absolute;
			z-index: -1;
		}

		.contents {
			overflow: hidden;
			margin: auto;
			margin-top: 196rpx;
			width: 686rpx;

			&_items {
				width: 686rpx;
				// height: 270rpx;
				background: #FFFFFF;
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				overflow: hidden;
				margin-bottom: 24rpx;

				&_venter {
					width: 630rpx;
					margin: auto;
					overflow: hidden;

					&_bottom {
						width: 100%;
						overflow: hidden;

						&_t1 {
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							margin-top: 14rpx;
							font-size: 32rpx;
							color: #1D2129;
						}

						&_t2 {
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 28rpx;
							color: #4E5969;
							// display: -webkit-box;
							// /* 设置为WebKit内核的弹性盒子模型 */
							// -webkit-box-orient: vertical;
							// /* 垂直排列 */
							// -webkit-line-clamp: 2;
							// /* 限制显示三行 */
							// overflow: hidden;
							// /* 隐藏超出范围的内容 */
							// text-overflow: ellipsis;
							// /* 使用省略号 */
							margin-top: 16rpx;
							margin-bottom: 24rpx;
						}
					}

					&_top {
						width: 100%;
						height: 94rpx;
						display: flex;
						align-items: center;
						border-bottom: 2rpx solid #F2F2F2;

						&_btn {
							width: 128rpx;
							height: 46rpx;
							background: #13A2E6;
							border-radius: 8rpx 8rpx 8rpx 8rpx;
							text-align: center;
							line-height: 46rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							font-size: 28rpx;
							color: #FFFFFF;
						}

						&_t1 {
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 28rpx;
							color: #86909C;
							margin-left: 24rpx;
						}
					}
				}
			}
		}





	}
</style>